﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ApiBetaSeries.Model;
using System.Xml;

namespace ApiBetaSeries.Factories
{
    public class ShowUserFactory
    {
        /// <summary>
        /// Create a Show of an User From Xml
        /// </summary>
        /// <param name="e">XmlNode</param>
        /// <returns>ShowUser</returns>
        [ApiBetaSeries.Version.ApiMethod(true, "members/infos")]
        public static IShowUser CreateShowUser(XmlNode e)
        {
            IShowUser show = new User.Show();

            show.Title = Utils.UtilsXML.GetStringValue(e, "title");
            show.Url = Utils.UtilsXML.GetStringValue(e, "url");
            show.Archived = Utils.UtilsXML.GetBoolValue(e, "archive");

            return show;
        }

        /// <summary>
        /// Create a new Show of an User
        /// </summary>
        /// <returns>ShowUser</returns>
        public static IShowUser CreateShowUser()
        {
            return new User.Show();
        }
    }
}
